package com.jdkreader.annotation;

import java.util.List;

/**
 * Created by 昭毅 on 2017-6-5.
 * 注解测试类
 */
public class AnnTest {

    @UserCase(id=1,description = "密码必须含有至少一个字母")
    public boolean validatePassword(String password){
        return password.matches("\\w*\\d\\w*");
    }
    @UserCase(id=2,description = "密码被加密了")
    public String encryptPassowrd(String password){

        return new  StringBuilder(password).reverse().toString();
    }
    @UserCase(id=3,description = "验证密码是否已被使用")
    public boolean checkForNewPassword(
            List<String> prevPassowrd,String password){
        return !prevPassowrd.contains(password);
    }

}
